Add Buildroot patches to fix CLAPACK 3.2.1 build failures with glibc 2.34 / newer GCC#3
Conversation
…/glibc - 0001: Add #include <stdio.h> to BLAS/SRC/xerbla.c to fix implicit printf error - 0002: Rename 'select' parameter to 'selectfn' in SRC/sgees.c to avoid conflict with POSIX select() symbol - 0003: Rename 'select' parameter to 'selectfn' in SRC/sgeesx.c for same reason Co-authored-by: fragfz <82901154+fragfz@users.noreply.github.com>
|
Thanks — root cause identified.
Please update the patch series as follows:
If possible, squash into a single commit titled: |
There was a problem hiding this comment.
🟢 Approval recommended
The changes are narrowly-scoped Buildroot patches that appear internally consistent and do not introduce API/ABI changes beyond local parameter naming.
Pull request overview
This PR adds downstream Buildroot package patches for CLAPACK 3.2.1 to restore compatibility with newer toolchains (glibc 2.34+ and newer GCC), addressing build failures in CLAPACK’s generated C sources.
Changes:
- Add a patch to include
<stdio.h>inBLAS/SRC/xerbla.cto fixprintf()implicit-declaration errors under modern GCC defaults. - Add patches to rename the
selectfunction-pointer parameter toselectfninSRC/sgees.candSRC/sgeesx.cto avoid symbol conflicts with POSIXselect().
File summaries
| File | Description |
|---|---|
| patches/buildroot-2023.11.3/packages/clapack/0001-clapack-xerbla-include-stdio.patch | Adds missing <stdio.h> include for printf() usage in xerbla.c. |
| patches/buildroot-2023.11.3/packages/clapack/0002-clapack-sgees-select-to-selectfn.patch | Renames select parameter to selectfn and updates its call sites in sgees.c. |
| patches/buildroot-2023.11.3/packages/clapack/0003-clapack-sgeesx-select-to-selectfn.patch | Renames select parameter to selectfn and updates its call sites in sgeesx.c. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
patches_buildroot-2023.11.3_packages_clapack_0004-clapack-sgges-typed-select.patch The patches 0004 and 0005 were missing in the last comment. Please: 0004-clapack-sgges-typed-select.patch Re-run build and confirm sgges.c / sggesx.c no longer fail with: If possible, squash into a single commit titled: |
There was a problem hiding this comment.
🟡 Changes recommended
The patch set appears incomplete for the stated “fix CLAPACK build failures” goal (reported remaining failures in sgges/sggesx) and the new patch files deviate from the repository’s established patch header format.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (3)
patches/buildroot-2023.11.3/packages/clapack/0001-clapack-xerbla-include-stdio.patch:2
- This patch file uses a bare unified diff header (starts with
---/+++) while other Buildroot patches in this repo use a git-style header starting withdiff --git ...(e.g. patches/buildroot-2023.11.3/packages/cmake/01_fix_build.patch:1). Keeping the same header format improves consistency with existing tooling and patch provenance.
--- a/BLAS/SRC/xerbla.c
+++ b/BLAS/SRC/xerbla.c
patches/buildroot-2023.11.3/packages/clapack/0002-clapack-sgees-select-to-selectfn.patch:2
- This patch file uses a bare unified diff header (starts with
---/+++) while other Buildroot patches in this repo use a git-style header starting withdiff --git ...(e.g. patches/buildroot-2023.11.3/packages/cmake/01_fix_build.patch:1). Keeping the same header format improves consistency with existing tooling and patch provenance.
--- a/SRC/sgees.c
+++ b/SRC/sgees.c
patches/buildroot-2023.11.3/packages/clapack/0003-clapack-sgeesx-select-to-selectfn.patch:2
- This patch file uses a bare unified diff header (starts with
---/+++) while other Buildroot patches in this repo use a git-style header starting withdiff --git ...(e.g. patches/buildroot-2023.11.3/packages/cmake/01_fix_build.patch:1). Keeping the same header format improves consistency with existing tooling and patch provenance.
--- a/SRC/sgeesx.c
+++ b/SRC/sgeesx.c
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
| -/* Subroutine */ int sgees_(char *jobvs, char *sort, L_fp select, integer *n, | ||
| +/* Subroutine */ int sgees_(char *jobvs, char *sort, L_fp selectfn, integer *n, | ||
| real *a, integer *lda, integer *sdim, real *wr, real *wi, real *vs, |
There was a problem hiding this comment.
Updated in ff96608. I changed only the two sgges/sggesx patch files so they now apply typed selctg callback signatures (logical (*selctg)(real *, real *, real *)), which addresses the missing coverage noted in this thread.
…tg patches Co-authored-by: fragfz <82901154+fragfz@users.noreply.github.com>
Co-authored-by: fragfz <82901154+fragfz@users.noreply.github.com>
Co-authored-by: fragfz <82901154+fragfz@users.noreply.github.com>
CLAPACK 3.2.1 fails to compile under newer GCC toolchains due to two separate issues: a missing
<stdio.h>forprintf()inxerbla.c, and a namespace collision where theselectparameter name shadows POSIXselect()exposed by<unistd.h>in glibc 2.34+.Changes
patches/buildroot-2023.11.3/packages/clapack/— new patch directory with three patch files:0001-clapack-xerbla-include-stdio.patch: Adds#include <stdio.h>toBLAS/SRC/xerbla.cto fix implicit-function-declaration error onprintf().0002-clapack-sgees-select-to-selectfn.patch: Renames theL_fp selectparameter toL_fp selectfnthroughoutSRC/sgees.c(signature + 2 call sites).0003-clapack-sgeesx-select-to-selectfn.patch: Sameselect→selectfnrename forSRC/sgeesx.c.The
selectrename resolves errors like:where the compiler resolves
selectto the zero-argument POSIX syscall stub instead of the intendedL_fpfunction pointer parameter.